package com.kun.pojo.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

/**
 * 订单日志表
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@TableName(value = "trade_goods_number_log")
public class TradeGoodsNumberLog {
    /**
     * 商品ID
     */
    @NotNull(message = "请传递商品ID！")
    private Long goodsId;

    /**
     * 订单ID
     */
    @TableId
    @NotNull(message = "请传递订单ID！")
    private Long orderId;

    /**
     * 库存数量
     */
    @Positive(message = "库存数量必须大于 0")
    private Integer goodsNumber;

    /**
     *
     */
    private Date logTime;

    public TradeGoodsNumberLog(Long goodsId, Long orderId, Integer goodsNumber) {
        this.goodsId = goodsId;
        this.orderId = orderId;
        this.goodsNumber = goodsNumber;
    }

    public TradeGoodsNumberLog(Long goodsId, Long orderId, Integer goodsNumber, Date logTime) {
        this.goodsId = goodsId;
        this.orderId = orderId;
        this.goodsNumber = goodsNumber;
        this.logTime = logTime;
    }
}
